package org.thunms.framework.views;

import java.io.IOException;
import java.util.UUID;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UUIDTag  extends TagSupport{
	private static final long serialVersionUID = -1042334603726120059L;
	private static final Logger logger = LoggerFactory.getLogger(UUIDTag.class);
	

	@Override
	public int doStartTag() throws JspException {
		try {
			JspWriter out = this.pageContext.getOut();
			out.print(UUID.randomUUID().toString());
		} catch (IOException e) {
			logger.error("生成数据选择标签代码时出现异常",e);
		}
		
		return SKIP_BODY;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	
}
